package com.yourcurtain.client.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.Widget;
import com.yourcurtain.client.HistoryManager;
import com.yourcurtain.client.widgets.videolist.VideoListWidget;

public class TitlesWidget extends Composite {

	private static TitlesWidgetUiBinder uiBinder = GWT
			.create(TitlesWidgetUiBinder.class);

	interface TitlesWidgetUiBinder extends UiBinder<Widget, TitlesWidget> {
	}

	@UiField
	HTMLPanel mainHP;
	@UiField
	MenuItem animeMI;
	
	VideoListWidget videoListWidget=new VideoListWidget();

	public TitlesWidget() {
		initWidget(uiBinder.createAndBindUi(this));
		 animeMI.setCommand(new Command(){
		
		 @Override
		 public void execute() {
		 HistoryManager.putTitle(HistoryManager.ANIME);
		 HistoryManager.addHistoryToken();
		
		 }});
	}

	public void playVideo() {
		GWT.log("play video");
		
		mainHP.clear();
		mainHP.add(videoListWidget);

	}

//	@UiHandler("animeMI")
//	public void clickOnAnimeLabel(Command command) {
//		command = new Command() {
//
//			@Override
//			public void execute() {
//				HistoryManager.putTitle(HistoryManager.ANIME);
//				HistoryManager.addHistoryToken();
//
//			}
//		};
//		command.execute();
//	}

}
